<style>
</style>
<template>
  <forms class="max" :config="config" @submit:forms="send">
    <template #test="{row}">
      <sku v-model:value="sku_arr" :config="{ban_price_vip:true}" is_info=""></sku>
    </template>
  </forms>
</template>
<script>
import sku from '@/components/auto_import/UnifyParam/sku.vue'
import s94Mjs from "s94-js";
import {ajax} from "@/js/api_tool.js";
export default {
  components: {sku},
  props: ['__iframe'],
  data(){
    var select_config_children = '选项1|1,选项2|2[选项2-选项1|21,选项2-选项2|22],选项3|3';
    var form_config = {
      time: {name:'time', label:'时间', type:'date', value: ""},
      content: {name:'content', label:'进度详情', type:'text_more', value: ""},
      position: {type:'position',label:'位置',name:'position'},
    };
    setTimeout(()=>{
      this.sku_config = {ban_price_vip:true, ban_stock:true};
    },3000)
    return {
      sku_arr: '[]',
      sku_config: {ban_stock:true},


      checked1: true,
      config: {
        test: {type: 'test', label:'测试', name:'test', value:false},

        text_one_code: {type:'text_one_code',label:'代码补齐',name:'text_one_code', value: '',tips:'' },
        validate_rule: {type:'validate_rule',label:'验证规则',name:'validate_rule', value: '["required","max:255"]',tips:''},

        text_one_computed: {type:'text_one',label:'单文本',name:'text_one_computed', value: "1",tips:'计算值功能', computed:"user_money_recharge"},
        text_one_upload: {type:'text_one',label:'单文本',name:'text_one_upload', value: "1",tips:'上传文件附带', upload:1},

        area_4l: {type:'area_4l',label:'选择区域',name:'area_4l',value:'3,39,495,4789'},

        json_param_arr: {name:'json_param_arr', label:'自定义参数集', type:'json_param_arr', config:form_config, is_info:false, value: "[{\"time\":\"2024-01-04 18:28:28\",\"content\":\"1231\"}]"},
        json_param: {name:'json_param', label:'自定义参数', type:'json_param', config:JSON.stringify(form_config), is_info:false, value: "{\"time\":\"2024-01-04 18:28:28\",\"content\":\"1231\"}"},

        file: {type:'file',label:'文件',name:'file',config:'',more:true, is_info:false, protocol:'http', value:'//taiyushangdao-saas.oss-cn-chengdu.aliyuncs.com/uploads/2023/0807/172823997639.mp3'},
        file_img: {type:'file_img',label:'单个图片',name:'file_img',value:'//s94Mjs.oss-cn-beijing.aliyuncs.com/uploads/logo.png'},
        file_imgs: {type:'file_imgs',label:'多个图片',name:'file_imgs'},
        wechat_file: {type:'wechat_file',label:'微信素材',name:'wechat_file',config:'jpg,png'},
        wechat_cert: {type:'wechat_cert',label:'微信证书',name:'wechat_cert',config:'jpg,png'},

        log_list: {label:'日志',name:'log_list', type:'log_list', value:'[{"time":"2023-06-05 15:52:29","content":"11111"}]'},
        iconfont: {type:'iconfont',label:'字体图标',name:'iconfont', value:'vant-icon friends-o'},
        position: {type:'position',label:'位置',name:'position', value:'107.03757037136839,35.76952494967395'},
        json: {type:'json',label:'json配置',name:'json', value:'', config:[] },
        duration: {type:'duration',label:'时长',name:'duration', value:0},
        list_id: {type:'list_id',label:'选择id',name:'list_id', config: "admin/index", value:2, is_info:false},
        list_ids: {type:'list_ids',label:'选择id-多个',name:'list_ids', config: "admin/index", value:'2,3'},
        text_one: {type:'text_one',label:'单文本',name:'text_one', value: "1", validate:["max:6"],tips:'111111111111'},
        text_more: {type:'text_more',label:'多行文本',name:'text_more', value: "1"},
        select_one: {type:'select_one',label:'下拉单选',name:'select_one',config: select_config_children, value: "22"},
        select_more: {type:'select_more',label:'下拉多选',name:'select_more',config: select_config_children, value: ""},
        checkbox1: {type:'checkbox',label:'多选',name:'checkbox1',config: '选项1|1,选项2|2', value: "3"},
        checkbox2: {type:'checkbox',label:'多选分组',name:'checkbox2',config: select_config_children, value: "1"},
        radio1: {type:'radio',label:'单选',name:'radio1',config: '选项1|1,选项2|2', is_info:false, value: "1"},
        switch: {type:'radio_switch',label:'开关',name:'switch',value: "1"},
        date: {type:'date',label:'日期',name:'date',config: 'Y-M', tips:'提交的值是格式的日期字符串', value:'2022-12-20 23:59:59'},
        date_between: {type:'date_between',label:'日期区间',name:'date_between',config: 'Y-M',value:'',tips: "提交的值同date"},
        datetime: {type:'datetime',label:'时间戳',name:'datetime',config: 'Y-M', tips:'提交的值是选择日期的时间戳(秒)',value:"1702483200"},
        datetime_between: {type:'datetime_between',label:'时间戳区间',name:'datetime_between',config: 'Y-M',value:"1740758400,1780243200", tips: "提交的值同datetime", add_radio:1},

        editor: {type:'editor',label:'编辑器',name:'editor',config:'',value:''},
      }
    }
  },
  methods: {
    send(){
      let data = {};
      s94Mjs.each(this.config, function (row){
        data[row.name] = row.value
      })
    }
  },
  mounted() {
    window['app'] = this;


  }
}
</script>
